feat(cli): add update-models command#3739
feat(cli): add update-models command#3739panoskava wants to merge 12 commits intocode-yeongyu:devfrom
Conversation
|
All contributors have signed the CLA. Thank you! ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
1 issue found across 7 files
Confidence score: 3/5
- There is a concrete behavior risk in
src/cli/update-models/update-models.ts: provider detection ignoresoptions.directory, so running with--directorymay build mappings from the wrong project. - Because this issue is severity 6/10 with high confidence (8/10) and is user-facing CLI behavior, this sits in moderate merge risk rather than a minor housekeeping concern.
- Pay close attention to
src/cli/update-models/update-models.ts- ensure provider detection resolves paths from the user-supplied directory to avoid cross-project mapping mistakes.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/cli/update-models/update-models.ts">
<violation number="1" location="src/cli/update-models/update-models.ts:56">
P2: Provider detection ignores `options.directory`, so `--directory` can generate mappings from the wrong project.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
When --directory option is passed to update-models, the provider detection now correctly uses the specified project directory instead of always using the current working directory. - Add optional directory parameter to detectCurrentConfig() - Add directory parameter to detectConfigFormat() for opencode.json detection - Pass directory to detectProvidersFromOmoConfig() for omo config detection - Update update-models.ts to pass directory to detect() Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
There was a problem hiding this comment.
0 issues found across 3 files (changes from recent commits).
Requires human review: Large PR modifies core config detection logic. Detected type inconsistency in UpdateModelsDeps interface and potential path confusion for project-level vs global configurations.
…--json Previously, running 'update-models --dry-run' without --json produced no console output despite returning successfully. Now it prints the human-readable dry-run message like 'Dry run: X entries would be updated, Y preserved, Z added'.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/cli/config-manager/detect-current-config.ts">
<violation number="1" location="src/cli/config-manager/detect-current-config.ts:18">
P1: Custom agent: **Opencode Compatibility**
Project config path was changed away from the canonical `.opencode/` location, so existing Opencode configs will not be detected.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Try running cubic reviews locally in CLI to avoid back-and-forth.
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Summary
Add
update-modelsCLI command to update model mappings with latest plugin recommendations. This command allows users to automatically synchronize their local model configurations with the latest recommended model mappings from the plugin.Changes
Added Files
src/cli/update-models/index.ts- Main entry point for update-models commandsrc/cli/update-models/update-models.ts- Core implementation with config loading, detection, and generationsrc/cli/update-models/types.ts- Type definitions for model mappings and configurationsrc/cli/update-models/compare-mappings.ts- Utility to compare and diff model mappingssrc/cli/update-models/compare-mappings.test.ts- Unit tests for comparison logicsrc/cli/update-models.test.ts- Comprehensive test suite for the commandModified Files
src/cli/cli-program.ts- Registered the newupdate-modelscommand in the CLI programTesting
Related Issues
Closes #3662
Need help on this PR? Tag
@codesmithwith what you need.